Incorporating GitHub Pull Requests 您所在的位置:网站首页 Apache VCL Incorporating GitHub Pull Requests

Incorporating GitHub Pull Requests

2024-07-03 00:58| 来源: 网络整理| 查看: 265

Created by Josh Thompson, last modified on Jun 05, 2018

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The Apache VCL code is maintained as a Git repository managed by ASF. That repository is mirrored to GitHub. Anyone on GitHub can fork the mirror, make changes, and submit pull requests against it. However, because the GitHub mirror of the repository is read-only, the pull requests cannot be directly merged into it. This page describes the process that must be followed to incorporate a pull request into the ASF maintained Git repository which, when done correctly, will cause the pull request on GitHub to be closed.

Because this process involves committing to the ASF maintained repository, only current committers to the project can perform all of these steps.

Remotes

First, you need to have remotes set up in your working copy for both the ASF maintained repo and the GitHub mirror. You can view your remotes with

git remote -v

If you don't already have both remotes set up, you can add them with

git remote add vcl-asf https://git-wip-us.apache.org/repos/asf/vcl.git git remote add vcl-github https://github.com/apache/vcl.git

If you already have remotes setup, but have different names, you'll need to change the names used in the commands on this page accordingly.

Working Copy

Next, set your working copy to be on the desired branch and ensure it is up to date.

git fetch vcl-asf git checkout git pull vcl-asf Grab Pull Request

The following command will grab the pull request into a new branch in your working copy. NUMBER represents the number of the pull request.

git fetch vcl-github pull/NUMBER/head:pr/NUMBER

If you will be working with a number of pull requests, you may want to issue the following configuration change to simplify things.

git config --add remote.vcl-github.fetch '+refs/pull/*/head:refs/remotes/vcl-github/pr/*'

After that, you can run the following two commands, which are a little easier to remember.

git fetch vcl-github git checkout pr/NUMBER View Changes

To view a diff of the changes between the branch you currently have checked out and the new one created from the pull request, use git diff:

git diff pr/NUMBER Merge Changes

Use the following command to merge the pull request. NOTE:聽The "--no-ff" argument and the comments are important. The phrase "This closes #NUMBER" must be included in the comment to cause the pull request to be closed on GitHub. Also, if a JIRA issue is associated with the work, the issue number (VCL-###) needs to be included in the comment.

git merge --no-ff -m "VCL-## - This closes #NUMBER" pr/NUMBER

For example, to handle PR#2 that addresses VCL-1101, the following would be used:

git merge --no-ff -m "VCL-1101 - This closes #2" pr/2 Push Changes to ASF

Optionally, diff the changes against the ASF repo to double check before pushing to it. should be the same branch that was checked out in the聽Working Copy section above.

git diff vcl-asf/

Finally, push the merge result to the ASF repo. This is the step that actually makes changes to the ASF repo and requires committer rights. Again,聽 should be the same branch that was checked out in the聽Working Copy聽section above.

git push vcl-asf No labels


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有